INCLUDE_PATH=/HPGCC-2.0-native-win32-SP2/include
LIBS_PATH=/HPGCC-2.0-native-win32-SP2/lib
ELF2HP_PATH=/HPGCC-2.0-native-win32-SP2/elf2hp
export CUR_DIR= $(shell pwd)
export CC= arm-elf-gcc
export C_FLAGS= -mtune=arm920t -mcpu=arm920t \
	-mlittle-endian -fomit-frame-pointer -msoft-float -Wall \
	-Os -I$(INCLUDE_PATH) -L$(LIBS_PATH) -mthumb-interwork -mthumb 
export LD= arm-elf-ld
export LD_FLAGS= -L$(LIBS_PATH) -T VCld.script $(LIBS_PATH)/crt0.o 
export LIBS= -lhplib -lgcc
export AR= arm-elf-ar
export ELF2HP= elf2hp

all: invaders.hp

invaders.hp: invaders.exe
	$(ELF2HP) $< $@

invaders.exe: invaders.o
	$(LD) $(LD_FLAGS) $< $(LIBS) -o $@

invaders.o: invaders.c invaders.h sprite.h
	$(CC) $(C_FLAGS) -c invaders.c

##############################################################################

clean: cleanup
	-rm -f *.hp

cleanup:
	-rm -f *.o
	-rm -f *.exe
	-rm -f *~
